<<<<<<< HEAD
/*
 * 作者：杨红伟
 * 日期：2017.05.10
 */
(function(window){
	var nuiWeixin = function(){
	};

	//显示模态提示
	var showToast = function(msg, duration, location) {
		var msg = msg ? msg : '错误';
		var duration = duration ? duration : '2000';
		var location = location ? location : 'bootom';
		api.toast({
			msg: msg,
			duration: duration,
			location: location
		});
	}

	nuiWeixin.prototype = {
		//分享网页
		shareWebPage : function(Vscene,title,description,thumb,contentUrl){
			if(typeof(api) == 'undefined'){
				console.log('该插件必须在APICloud中运行');
			}else{
				var wx = api.require('wx');
				wx.shareWebPage({
					apiKey : '',
					scene : Vscene,
					title : title,
					description : description,
					thumb : thumb,
					contentUrl : contentUrl
				},function(ret,err){
					if(ret.status){
						showToast('分享成功！',2,'bottom');
					}else{
						showToast('分享失败！',2,'bottom')
					}
				})
			}
		},

	};

	window.nuiWeixin = nuiWeixin;
})(window);






















=======
(function(window){
	var u = {};
	var isAndroid = (/android/gi).test(navigator.appVersion);
	var uzStorage = function(){
		var ls = window.localStorage;
		if(isAndroid){
			ls = os.localStorage();
		}
		return ls;
	};
	function parseArguments(data,fnSuc,dataType){
		if(typeof(data) == 'funciton'){
			dataType = fnSuc;
			fnSuc = data;
			data = undefined;
		}
		if(typeof(fnSuc) != 'function'){
			dataType = fnSuc;
			fnSuc = undefined;
		}
		return {
			url:url,
			data:data,
			fnSuc:fnSuc,
			dataType:dataType
		};
	};
	u.trim = function(str){
		if(String.prototype.trim){
			return str == null ? "" : String.prototype.trim.call(str);
		}else{
			return str.replace(/(^\s*)|(\s*$)/g,'');
		}
	};
	u.trimAll = function(){
		return str.replace(/\s*/g,'');
	};
	u.isElement = function(obj){
		return !!(obj && obj.nodeType == 1);
	};
	u.isArray = function(obj){
		if(Array.isArray){
			return Array.isArray(obj);
		}else{
			return obj instanceof Array;
		}
	};
	u.isEmptyObject = function(obj){
		if(JSON.stringify(obj) === '{}' ){
			return true;
		}else{
			return false;
		}
	};
	u.addEvt = function(el,name,fn,useCapture){
		if(!u.isElement(el)){
			console.warn('$api.addEvt Function need el param,el param must be DOM Element');
			return;
		}
		useCapture = useCapture || false;
		if(el.addEventListener){
			el.addEventListener(name,fn,useCapture);
		}
	};
	u.rmEvt = function(el,name,fn,useCapture){
		if(!u.isElement(el)){
			console.warn('$api.rmEvt Function need e3l param,el param must be DOM Element');
			return;
		}
		useCapture = useCapture || false;
		if(el.removeEventListener){
			el.removeEventListener(name,fn,useCapture);
		}
	};
	u.one = function(){};
	u.dom = function(){};
	u.domAll = function(){};
	u.byId = function(){};
	u.first = function(){};
	u.last = function(){};
	u.eq = function(){};
	u.not = function(){};
	u.prev = function(){};
	u.next = function(){};
	u.closeset = function(){};
	u.attr = function(){};
	u.removeAttr = function(){};
	u.hasClass = function(){};
	u.addCls = function(){};
	u.removeCls = function(){};
	u.toggleCls = function(){};
	u.val = function(){};
	u.prepend = function(){};
	u.append = function(){};
	u.before = function(){};
	u.after = function(){};
	u.html = function(){};
	u.text = function(){};
	u.offset = function(){};
	u.css = function(){};
	u.cssVal = function(){};
	u.jsonToStr = function(){};
	u.strToJson = function(){};
	u.setStorage = function(){};
	u.getStorage = function(){};
	u.rmStorage = function(){};
	u.clearStorage = function(){};
	u.fixIos7Bar = function(){};
	u.toast = function(){};
	u.post = function(){};
	u.get = function(){};


	window.$newapi = u;
})(window);
>>>>>>> 67388f88122d0b30eed381c4fe4a96d401e13a28
